﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};
	
	var authtypeData = Jxstar.findComboData('authtype');
	var planyearData = Jxstar.findComboData('planyear');
	var yesnoData = Jxstar.findComboData('yesno');
	var baotypeData = Jxstar.findComboData('baotype');
	var moneytypeData = Jxstar.findComboData('moneytype');
	var plantypeData = Jxstar.findComboData('plantype');
	var planstatusData = Jxstar.findComboData('planstatus');
	var auditData = Jxstar.findComboData('audit');
	var items = [{
		width:'97%',
		border:false,
		layout:'form',
		autoHeight:true,
		xtype:'container',
		style:'padding:5 10 5 10;',
		items:[{
			anchor:'100%',
			border:false,
			xtype:'container',
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				xtype:'container',
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textfield', fieldLabel:'项目名称', name:'money_plan__plan_name', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'combo', fieldLabel:'授权形式', name:'money_plan__auth_type', defaultval:'ty',
						anchor:'100%', editable:false, allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*',
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: authtypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: authtypeData[0][0]},
					{xtype:'trigger', fieldLabel:'主管部门', name:'money_plan__done_deptname',
						anchor:'100%', triggerClass:'x-form-search-trigger',
						maxLength:50, allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', editable:false,
						onTriggerClick: function() {
							var selcfg = {pageType:'combogrid', nodeId:'sys_dept', layoutPage:'/public/layout/layout_tree.js', sourceField:'sys_dept.dept_name;dept_id', targetField:'money_plan.done_deptname;done_deptid', whereSql:"dept_id like '1001%' and dept_level = '2'", whereValue:'', whereType:'', isSame:'0', isShowData:'1', isMoreSelect:'0',isReadonly:'1',queryField:'',likeType:'',fieldName:'money_plan.done_deptname'};
							JxSelect.createSelectWin(selcfg, this, 'node_money_auth_form');
						}},
					{xtype:'textfield', fieldLabel:'型号规格', name:'money_plan__device_size', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'numberfield', decimalPrecision:2, fieldLabel:'数量', name:'money_plan__plan_num', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'预计总投资(万元)', name:'money_plan__plan_money', defaultval:'0', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'当年预计付款(万元)', name:'money_plan__year_money', defaultval:'0', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%', maxLength:12},
					{xtype:'combo', fieldLabel:'预算年度', name:'money_plan__plan_year',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: planyearData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: planyearData[0][0]},
					{xtype:'textfield', fieldLabel:'实施部门', name:'money_plan__dept_name', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'datefield', fieldLabel:'申报日期', name:'money_plan__plan_date', format:'Y-m-d', anchor:'100%', readOnly:true},
					{xtype:'combo', fieldLabel:'是否结转', name:'money_plan__is_turn', defaultval:'0',
						anchor:'100%', editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: yesnoData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: yesnoData[0][0]},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'立项批复金额(万元)', name:'money_plan__project_money', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'combo', fieldLabel:'计划包属性', name:'money_plan__bao_type',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: baotypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: baotypeData[0][0]},
					{xtype:'hidden', fieldLabel:'主键', name:'money_plan__plan_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'实施部门ID', name:'money_plan__dept_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'授权人登记id', name:'money_plan__auth_userid', defaultval:'fun_getUserId()', anchor:'100%'}
				]
			},{
				border:false,
				xtype:'container',
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'combo', fieldLabel:'项目类别', name:'money_plan__money_type',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: moneytypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: moneytypeData[0][0]},
					{xtype:'textfield', fieldLabel:'授权登记人', name:'money_plan__auth_user', defaultval:'fun_getUserName()', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'datefield', fieldLabel:'批复时间', name:'money_plan__auth_date', defaultval:'fun_getToday()', format:'Y-m-d', anchor:'100%', readOnly:true},
					{xtype:'textfield', fieldLabel:'单位', name:'money_plan__plan_unit', readOnly:true, anchor:'100%', maxLength:10},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'单价(万元)', name:'money_plan__plan_price', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'textfield', fieldLabel:'预计实施时间', name:'money_plan__plan_period', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'计划编号', name:'money_plan__plan_code', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'combo', fieldLabel:'计划类型', name:'money_plan__plan_type', defaultval:'yd',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: plantypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: plantypeData[0][0]},
					{xtype:'combo', fieldLabel:'计划状态', name:'money_plan__plan_status', defaultval:'11',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: planstatusData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: planstatusData[0][0]},
					{xtype:'textfield', fieldLabel:'申报人', name:'money_plan__plan_user', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'立项批复文号', name:'money_plan__project_fileno', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'combo', fieldLabel:'记录状态', name:'money_plan__audit_sq', defaultval:'0',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: auditData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: auditData[0][0]},
					{xtype:'hidden', fieldLabel:'申报人ID', name:'money_plan__plan_userid', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'主管部门ID', name:'money_plan__done_deptid', anchor:'100%'}
				]
			}
			]
		},{
			anchor:'100%',
			border:false,
			xtype:'container',
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				xtype:'container',
				columnWidth:0.99,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textarea', fieldLabel:'建设内容及方案', name:'money_plan__plan_desc', readOnly:true, width:'100%', height:48, maxLength:4000},
					{xtype:'textarea', fieldLabel:'备注', name:'money_plan__plan_memo', readOnly:true, width:'100%', height:48, maxLength:200}
				]
			}
			]
		}]
	}];
	
	config.param = {
		items: items,
		funid: 'money_auth'
	};

	
	config.eventcfg = {		//初始化页面数据		initOther : function() {			var myform = this.form;			var auth_date = myform.get("money_plan__auth_date");			if (auth_date == null || auth_date == "") {				myform.set("money_plan__auth_date", JxDefault.getToday());			}						var auth_user = myform.get("money_plan__auth_user");			if (auth_user == null || auth_user == "") {				myform.set("money_plan__auth_user", JxDefault.getUserName());				myform.set("money_plan__auth_userid", JxDefault.getUserId());			}		}	};
	
	return new Jxstar.FormNode(config);
}